package com.example.plan.controller;

import com.example.plan.service.DjiCloudApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.List;

/**
 * @ClassName DJICloudAPI
 * @Description TODO
 * @Author renhong~Deng
 * @Date 2025/4/9 11:10
 * @Version 1.0
 */

@RestController
@RequestMapping("/dji")
public class DjiCloudApiController {

    @Autowired
    private DjiCloudApiService djiCloudApiService;

    @GetMapping("/drone-data")
    public String getDroneData() throws IOException {
        return djiCloudApiService.getDroneData();
    }

    @PostMapping("/create-mission")
    public String createWaypointMission(@RequestBody List<DjiCloudApiService.Waypoint> waypoints) throws IOException {
        return djiCloudApiService.createWaypointMission(waypoints);
    }

    @PostMapping("/start-mission/{missionId}")
    public String startWaypointMission(@PathVariable String missionId) throws IOException {
        return djiCloudApiService.startWaypointMission(missionId);
    }

    // 可以添加其他API调用方法
}
